import React from 'react'
type ProTotype = {
  name: string,
  color?: string,
  size?: number,
  onClick?: any,
  stop?: boolean
}
function Icon(props: ProTotype) {
  return <span
    className={'iconfont'}
    style={{ color: props.color, fontSize: props.size }}
    onClick={
      (e) => {
        if(props.onClick){
          props.onClick()
          if (props.stop) {
            e.stopPropagation();
          }
        }
        
      }
    }
  >
    {props.name}
  </span>



}
Icon.defaultProps = {
  size: 16,
  color: '#333',
  stop: true,
  onclick: () => {}
}
export default Icon